<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>供应商管理</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link rel="stylesheet" href="css/dingdan.css" />
		<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
		<link rel="stylesheet" type="text/css" href="https://at.alicdn.com/t/font_1322088_85ilyeoj677.css"/>
		<link rel="stylesheet" type="text/css" href="css/style.css"/>
		<link rel="stylesheet" type="text/css" href="js/layui/css/layui.css"/>
		<link rel="stylesheet" href="js/layer/mobile/need/layer.css" />
		<link rel="stylesheet" href="css/caiStyle.css" />
	</head>
	<style>
	</style>
	<body>
		<div class="container-fluid bg-white">
			<!-- 订单列表 -->
			<div class="order order-box">
				<div class="ood-box">
					<!-- 顶部工具条 -->
					<nav class="flex">
						<!-- 默认显示的操作栏 -->
						<div class="dutault-nav width100 flex">
							<div class="heard-left width100 flex">
								<div class="col-md-2 nav-tab-box padding-0 nav-tab-box1">
									<div class="sle-box"><span class="changeSelectData">全部仓库</span><i class="iconfont icon-xiangxia"></i></div>
									<div onclick="closeMain()" class="show-sle-box show-sle-box1">
										<div class="show-sle show-sle1">
											<ul class="mp00">
												<li class="list-none">全部仓库</li>
												<li class="list-none">深圳仓库</li>
												<li class="list-none">上海仓库</li>
												<li class="list-none">北京仓库</li>
											</ul>
										</div>
									</div>
								</div>
								<div class="col-md-3 padding-0">
									<input type="text" class="layui-input cr_secrh" placeholder="请输入订单号/经销商名称" value="" />
										<i class="iconfont icon-search cr_souso"></i>
								</div>
							<div class="heard-right heard-btn col-md-8 padding-0 flex rightFloat heard-btn">
								<button type="button" onclick="added()">新增</button>
							</div>
						</div>
						<!-- 选择订单后显示操作栏 -->
						<div class="caozuo-nav hidden flex">
							<div class="nav-item"><i class="iconfont icon-guanbi hidden"></i>已选择<span class="changeNum">30</span>项</div>
							<div class="nav-item" onclick="upperShelf()"><i class="iconfont icon-dayin1"></i>打印</div>
						</div>
					</nav>
					<!-- 数据列表 -->
					<div class="order-list">
						<table id="order-list" lay-filter="test"></table>
					</div>
				</div>
			</div>
			
			<!-- 新增订单 -->
			<div class="order hidden add-order">
				
			</div>
			
			<!-- 导入订单 -->
			<div class="order hidden import-order">44</div>
			
			<!-- 高级搜索弹出层 -->
		</div>
		<script src="js/jquery-v3-3.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/layui/layui.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/new_file.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/Gather.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/html" id="barDemo">
			<a class="layui-btn layui-btn-xs  layui-btn-danger" lay-event="edit" id="test2">修改</a>
		  <a class="layui-btn layui-btn-xs " lay-event="" id="test1">删除</a>
		  <a class="layui-btn layui-btn-xs layui-btn-warm" lay-event="" id="test3">供货商品</a>
	  </script>
		<script type="text/javascript">
			$(function(){
				var height = document.documentElement.clientHeight;
				$(".container-fluid").css({"height":(height+34)+"px"})
			})
			
			$(window).resize(function(){
				var height = document.documentElement.clientHeight;
				$(".container-fluid").css({"height":(height+67)+"px"})
			})
			
			$(".nav-tab-box .sle-box").click(function(){
				$(this).next().slideToggle(100)
			})
			
			function closeMain(){
				$(".nav-tab-box .show-sle-box").slideToggle(100)
			}
			
			
			function showTabMain(num){
				if(num > 0){
					$(".heard-left").addClass("hidden")
					$(".caozuo-nav").removeClass("hidden")
				}else{
					$(".heard-left").removeClass("hidden")
					$(".caozuo-nav").addClass("hidden")
				}
				
				$(".changeNum").text(num)
			}
			//全部分类的显示隐藏
			function closeMain(){
				$(".nav-tab-box .show-sle-box1").slideToggle(100)
			}
			//获取全部分类子目录的值
			$(".nav-tab-box .show-sle-box1 .list-none").click(function(){
				$(".sle-box .changeSelectData").text($(this).text())
			})
			
				//打开页面方法
			function added(){   //新增
				window.open('gysgl_xz.html','_self');
			}
			//列表渲染
			layui.use(['form','table','laydate','element'], function(){
				var table = layui.table,
				laydate = layui.laydate,
				form = layui.form,
				element = layui.element
				
				//单元格点击事件跳转页面
				table.on('tool(test)', function(obj){
					//跳转到新增页面
					if(obj.event == 'edit'){
						window.open('gysgl_xz.html?data='+obj.data, '_self');
					}
				});
				// 数据列表渲染
				table.render({
					elem: '#order-list'
					,data:dataArray// data为数据库查到的数据
					,height:500
					,cols: [[//以下field字段为为数据库相同,title为字段描述
						{field:'sortrank',title: '供应商编码'}
						,{field:'spacesta',title: '供应商名称'}
						,{field:'dutyadmin',title: '地址'}
						,{field:'typeid',title: '联系人'}
						,{field:'writer',title: '联系方式'}
						,{field:'writer',title: '状态'}
						 ,{fixed: 'right', title:'操作', event:'remark',toolbar: '#barDemo',width:210}
					]]
					,page: true
				});
				
				
				//监听行单击事件
				table.on('row(test)', function(obj){
				  console.log(obj.tr) //得到当前行元素对象
				  console.log(obj.data) //得到当前行数据
				  //obj.del(); //删除当前行
				  //obj.update(fields) //修改当前行数据
//				  window.open('ddxq.html?data='+obj.data, '_self');
				});
			});
			
			
			//列表的操作
			
		</script>
	</body>
</html>
